package com.lxhjh.springboot.demo.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lxhjh.springboot.demo.service.HelloService;

@Component
public class HelloJob implements Job {
	
	@Autowired
	HelloService helloService;

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		//HelloService helloService=(HelloService)SpringContext.getBean("helloService");
		String name=context.getJobDetail().getJobDataMap().getString("name");
		helloService.sayHello(name);
	}

}
